﻿/*
 * @author: wizardc
 */

using Dou.Utils;
using DouEditor.Const;

namespace DouEditor.Resource
{
    /// <summary>
    /// 打包结束
    /// </summary>
    public class BuildStep_End : BuildStepBase
    {
        private bool _isBuildABOrPackage;
        
        public BuildStep_End(bool isBuildABOrPackage)
        {
            _isBuildABOrPackage = isBuildABOrPackage;
        }
        
        protected override void Start()
        {
            BuildStepData buildStepData = null;
            BuildPackageStepData buildPackageStepData = null;
            if (_isBuildABOrPackage)
            {
                buildStepData = (BuildStepData) _buildStepData;
            }
            else
            {
                buildPackageStepData = (BuildPackageStepData) _buildStepData;
            }
            
            Log.Warning($"打{(_isBuildABOrPackage ? "AB" : "安装")}包耗时：{Log.GetElapsedTime(BuildTimeConst.BuildAllTime, true, false) / 1000}s");
            
            // 通知 OA
            
            
            Complete();
        }
    }
}
